/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.skuboard.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author clockbuilder
 */
@Entity
@Table(name = "grades")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Grades.findAll", query = "SELECT g FROM Grades g"),
    @NamedQuery(name = "Grades.findByGrade", query = "SELECT g FROM Grades g WHERE g.grade = :grade"),
    @NamedQuery(name = "Grades.findByLowerBound", query = "SELECT g FROM Grades g WHERE g.lowerBound = :lowerBound"),
    @NamedQuery(name = "Grades.findByUpperBound", query = "SELECT g FROM Grades g WHERE g.upperBound = :upperBound"),
    @NamedQuery(name = "Grades.findByDetails", query = "SELECT g FROM Grades g WHERE g.details = :details")})
public class Grades implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "grade")
    private Character grade;
    @Basic(optional = false)
    @NotNull
    @Column(name = "lowerBound")
    private float lowerBound;
    @Basic(optional = false)
    @NotNull
    @Column(name = "upperBound")
    private float upperBound;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "details")
    private String details;

    public Grades() {
    }

    public Grades(Character grade) {
        this.grade = grade;
    }

    public Grades(Character grade, float lowerBound, float upperBound, String details) {
        this.grade = grade;
        this.lowerBound = lowerBound;
        this.upperBound = upperBound;
        this.details = details;
    }

    public Character getGrade() {
        return grade;
    }

    public void setGrade(Character grade) {
        this.grade = grade;
    }

    public float getLowerBound() {
        return lowerBound;
    }

    public void setLowerBound(float lowerBound) {
        this.lowerBound = lowerBound;
    }

    public float getUpperBound() {
        return upperBound;
    }

    public void setUpperBound(float upperBound) {
        this.upperBound = upperBound;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (grade != null ? grade.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grades)) {
            return false;
        }
        Grades other = (Grades) object;
        if ((this.grade == null && other.grade != null) || (this.grade != null && !this.grade.equals(other.grade))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.skuboard.entity.Grades[ grade=" + grade + " ]";
    }
    
}
